home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / smfdoor / frmdelet.frm (.txt) < prev    next >
Visual Basic Form  |  1999-09-11  |  2KB  |  82 lines

  1. VERSION 5.00
  2. Begin VB.Form frmDeleteFavorite 
  3.    BackColor       =   &H00000000&
  4.    Caption         =   "Select a favorite to delete."
  5.    ClientHeight    =   3090
  6.    ClientLeft      =   60
  7.    ClientTop       =   405
  8.    ClientWidth     =   4680
  9.    Icon            =   "frmDeleteFavorite.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    ScaleHeight     =   3090
  13.    ScaleWidth      =   4680
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.CommandButton cmdDelete 
  16.       Caption         =   "Delete Favorite"
  17.       Height          =   375
  18.       Left            =   600
  19.       TabIndex        =   2
  20.       Top             =   2640
  21.       Width           =   1455
  22.    End
  23.    Begin VB.CommandButton cmdDone 
  24.       Caption         =   "Done"
  25.       Height          =   375
  26.       Left            =   2640
  27.       TabIndex        =   1
  28.       Top             =   2640
  29.       Width           =   1575
  30.    End
  31.    Begin VB.ListBox List1 
  32.       Height          =   2400
  33.       Left            =   120
  34.       TabIndex        =   0
  35.       Top             =   120
  36.       Width           =   4455
  37.    End
  38. Attribute VB_Name = "frmDeleteFavorite"
  39. Attribute VB_GlobalNameSpace = False
  40. Attribute VB_Creatable = False
  41. Attribute VB_PredeclaredId = True
  42. Attribute VB_Exposed = False
  43. Private Sub cmdCancel_Click()
  44. frmDeleteFavorite.Hide
  45. End Sub
  46. Private Sub cmdDone_Click()
  47.     List1.Clear
  48.     frmDeleteFavorite.Hide
  49. End Sub
  50. Private Sub cmddelete_Click()
  51. Dim rownumber As Integer
  52.     x = List1.List(ListIndex)
  53.     rownumber = List1.ListIndex
  54.     List1.List(rownumber) = ""
  55. rownumber = 0
  56. On Error GoTo errorhandler
  57.     Open App.Path + "\Favorites" For Output As #1
  58.         Do Until rownumber = List1.ListCount '""
  59.            favorite = List1.List(rownumber)
  60.             If List1.List(rownumber) <> "" Then Write #1, favorite
  61.             rownumber = rownumber + 1
  62.         Loop
  63.     Close #1
  64. errorhandler:
  65.     Exit Sub
  66. End Sub
  67. Private Sub Form_Activate()
  68. Dim favorites(1000)
  69. Open App.Path + "\Favorites" For Input As #1
  70. Do While Not EOF(1)
  71. Input #1, favorites(x)
  72. List1.AddItem favorites(x)
  73. x = x + 1
  74. Close #1
  75. End Sub
  76. Private Sub Form_Unload(Cancel As Integer)
  77. List1.Clear
  78. End Sub
  79. Private Sub List1_Click()
  80.     cmdDelete.Enabled = True
  81. End Sub
  82.